package com.kyzh.core.uis

import android.view.ViewManager
import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.google.android.material.tabs.TabLayout
import com.scwang.smart.refresh.layout.SmartRefreshLayout
import org.jetbrains.anko.custom.ankoView


inline fun ViewManager.tablayout(init: TabLayout.() -> Unit): TabLayout {
    return ankoView({ TabLayout(it) }, theme = 0, init = init)
}

inline fun ViewManager.recyclerView(init: RecyclerView.() -> Unit): RecyclerView {
    return ankoView({ RecyclerView(it) }, theme = 0, init = init)
}
inline fun ViewManager.smartRefreshLayout(theme: Int = 0,init: SmartRefreshLayout.() -> Unit): SmartRefreshLayout {
    return ankoView({ SmartRefreshLayout(it) }, theme = 0, init = init)
}
inline fun ViewManager.smartRefreshLayout(theme: Int = 0) = smartRefreshLayout(theme) {}
inline fun ViewManager.swipeRefreshLayout(theme: Int = 0, init: SwipeRefreshLayout.() -> Unit): SwipeRefreshLayout {
    return ankoView({ SwipeRefreshLayout(it) }, theme = 0, init = init)
}

